import traffic.Trafficlight;
import input.Inputs;

import java.lang.Thread;
import java.util.Scanner;

public class Program {

    public static void main(String[] args) {
        Trafficlight light = new Trafficlight();

        Scanner scanner = new Scanner(System.in);
        Thread inputsred = new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    String input = scanner.nextLine();
                    switch (!input.equals("") ? input.charAt(0) : '\n') {
                        case 'j':
                            light.request(Inputs.CARAPPROACHES);
                            break;
                        case 'k':
                            light.request(Inputs.BUTTONPEDESTRIAN);
                            break;
                    }
                }
            }
        });
        inputsred.start();
    }

}